"""
Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.
The overall run time complexity should be O(log (m+n))
"""
from typing import List


class Solution:
    def findMedianSortedArrays( nums1: List[int], nums2: List[int]) -> float:
        list1 = nums1 + nums2
        list1.sort()
        if len(list1)%2==0:
            return (list1[len(list1)//2]+list1[len(list1)//2-1])/2
        else:
            return list1[len(list1)//2]

    num1=[1,3]
    num2=[2]
    print(findMedianSortedArrays(num1,num2))
